The EditSheet is the workhorse of an edit page. It can display an editable form in a preformated table or in a template of free-form DHTML. The EditSheet also enables sophisticated control of each field (for more detail on fields see the EditField reference). When not using a template to freely format your EditSheet group with DHTML, fields are listed in a table format in the order that the fields are specified in the meta-data.
Test:
| onError |
fires on error (when m_bDebug = true in HTC, shows alert as well)
event object propertieswindow.event.error String. Returns error detail. |
| onChange |
| fires when any sub-control value is changed. |
| onRequire |
fires when required status changes on any sub-control
event object propertieswindow.event.required Boolean. Returns true if any sub-control is marked as required and is currently empty, false otherwise |
| onValid |
fires when valid status changes on any sub-control
event object propertieswindow.event.valid Boolean. Returns false if any sub-control is currently invalid, true otherwise |
| set elEditField = elEditSheet.field(sFieldId) |
Gets the sub-control field element (HTML element with HTC attached)
parameterssFieldId Required. ID of field (column/field name in recordset). May be field in standard EditSheet layout or template. Also includes EditFields embedded in an EditSheet template return valueHTMLElement. Returns the sub-control element for the field if sFieldId is a valid field in the elEditSheet, null otherwise remarksOnce you have used this method to get a field control element you can use any of the methods and properties available to an EditField control. Please see the EditField reference for details. |
| bHidden = elEditSheet.hidden(sFieldId) |
Gets the current hidden state of the control row
parameterssFieldId Required. ID of field (column/field name in recordset). May only be field in standard EditSheet layout, not template. return valueBoolean. true if hidden, false if not |
| elEditSheet.hide(sFieldId) |
Hides the field row
parameterssFieldId Required. ID of field (column/field name in recordset). May only be field in standard EditSheet layout, not template. return valuenone |
| elEditSheet.show(sFieldId) |
Shows the field row
parameterssFieldId Required. ID of field (column/field name in recordset). May only be field in standard EditSheet layout, not template. return valuenone |
| elEditSheet.focus() |
sets focus to the control (if control not disabled)
parametersnone return valuenone |
| elEditSheet.resetDefault() |
resets all subcontrol values for fields that have field nodes in the
EditSheet metaData to the default set for that control, or an empty string
if no default set
parametersnone return valuenone |
| elEditSheet.resetDirty() |
resets dirty to false
parametersnone return valuenone |
| DataXML |
xml data (from a recordset) data-island id. Usually in the format:
<document> <record> <fieldId1>fieldValue1</fieldId1> <fieldId2>fieldValue2</fieldId2> ... </record> ... </document> |
| MetaXML | xml meta-data data-island id |
| bValue = elEditSheet.dirty |
| Read-only. Returns true if any field value's in the control have been changed, false otherwise. |
| bValue = elEditSheet.required |
| Read-only. Returns true if any field in the EditSheet is required and currently has no value, false otherwise. OnRequire event fires when this value changes. |
| bValue = elEditSheet.valid |
| Read-only. Returns false if any field in the EditSheet is currently invalid, true otherwise. OnValid event fires when this value changes. |
<xml id='esMeta'> <editsheets> <editsheet> <global expanded='no'> <name><U>d</U>epartment</name> <key>d</key> </global> <fields> <text id='dept_name' required='yes' readonly='yes' maxlen='50'> <name>Dept Name</name> <tooltip>tooltip for dept_name</tooltip> <charmask></charmask> <error>error for dept_name</error> </text> <text id='dept_desc' required='yes' maxlen='30' subtype='long'> <name>Description</name> <tooltip>tooltip for dept_desc</tooltip> <charmask></charmask> <error>error for dept_desc</error> </text> </fields> </editsheet> <editsheet> <global expanded='yes'> <name><U>t</U>emplate</name> <key>t</key> </global> <fields> <select id='deptid'> <name>Department</name> <tooltip>tooltip for deptid</tooltip> <select id='deptid'> <option value='1'>dept 1</option> <option value='2'>dept 2</option> <option value='3'>dept 3</option> </select> </select> <numeric id='sku' required='yes' min='0' max='10000' subtype='integer'> <name>SKU</name> <tooltip>tooltip for sku</tooltip> <error>error for sku</error> </numeric> </fields> <template fields='deptid sku' register='checkbox1'><![CDATA[ <B>Department id:</B> <DIV ID='deptid' STYLE='WIDTH: 300px' MetaXML='esMeta' DataXML='esData'><H3 ALIGN="center">Loading property...</H3> </DIV> <B>Sku:</B> <DIV ID='sku' STYLE='WIDTH: 300px' MetaXML='esMeta' DataXML='esData'><H3 ALIGN="center">Loading property...</H3> </DIV> <BR> <INPUT type="checkbox" id=checkbox1 name=checkbox1><LABEL FOR=checkbox1>additional HTML controls</LABEL> ]]></template> </editsheet> </editsheets> </xml>